﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master"Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	SelectNhaDat
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent1" runat="server">
	<span class="AdminTitle" style="color:#cc0000;">NhaDat Management</span>
	(<a href="<%= Url.Action("Index", "Home") %>" class="AdminPageText">
	<%= WebConfiguration.SiteName  %>
	</a>)
	<br />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent2" runat="server">
	<script src="../../Scripts/fckeditor/fckeditor.js" type="text/javascript"></script>
	<script type="text/javascript">
		window.onload = function () {
			var objFckEditor = new FCKeditor('NhaDat_NoiDung');
			objFckEditor.BasePath = '<%= ResolveUrl("~/Scripts/fckeditor/")%>';
			objFckEditor.Height = 480;
			objFckEditor.Width = 600;
			objFckEditor.ToolbarSet = 'MyTemplateWebToolbar';
			objFckEditor.ReplaceTextarea();
			<% if (Model.NhaDatModel.EditModel.Edited){ %>
				alert("Item has been updated!");
			<% } %>
		}

        function CheckOnTieuBieu(){
            var tieubieu = document.getElementsByName("NhaDat_TieuBieu").item(0);
            var tinvip = document.getElementsByName("NhaDat_TinVip").item(0);
            if ($("#NhaDat_TieuBieu").attr("checked")) {
                  $("#NhaDat_TinVip").attr("checked", false);
            }
        }

        function CheckOnTinVip(){
            var tieubieu = document.getElementsByName("NhaDat_TieuBieu").item(0);
            var tinvip = document.getElementsByName("NhaDat_TinVip").item(0);
            if ($("#NhaDat_TinVip").attr("checked")) {
                  $("#NhaDat_TieuBieu").attr("checked", false);
            }
        }
	</script>
	<% using (Html.BeginForm("UpdateNhaDatDuAn", "Admin", FormMethod.Post, new { enctype = "multipart/form-data", onsubmit = "return ValidateNhaDat();" }))
	{ %>
		<input type="hidden" name="NhaDat_ID" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].ID %>" />
		<input type="hidden" name="NhaDat_IDLoaiBatDongSan" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].IDLoaiBatDongSan %>" />
		<input type="hidden" name="NhaDat_IDQuanHuyen" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].IDQuanHuyen %>" />
		<input type="hidden" name="NhaDat_IDNguoiDang" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].IDNguoiDang %>" />
		<div style="padding-top: 30px">
            <span style="font-size:18px; font-weight:bold;">Detail Of Nha Dat Du An</span>
            <br />
            <br />
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="AdminPageText">
				<tbody>
                    <tr>
                        <td colspan="2" style="border-bottom:thin solid #ff0000;">
                            <span style="font-size:14px; font-weight:bold; ">Thông tin</span>
                        </td>
                    </tr>
					<tr>
                        <td>
					        <div align="left" style="padding-top:15px">
						        <font class="normal8">DiaChi: </font>
					        </div>
				        </td>
				        <td height="15">
					        <div align="left" style="padding-top:10px;">
                                <input name="NhaDat_DiaChi" style="width: 450px;" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].DiaChi %>" />
					        </div>
				        </td>
					</tr>
                    <tr>
                        <td>
					        <div align="left" style="padding-top:15px">
						        <font class="normal8">Giá: </font>
					        </div>
				        </td>
				        <td height="15">
					        <div align="left" style="padding-top:10px;">
                                <input name="NhaDat_Gia" style="width: 150px;" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].Gia %>"/>
					        </div>
				        </td>
					</tr>
                    <tr>
                        <td>
					        <div align="left" style="padding-top:15px">
						        <font class="normal8">Loại giá: </font>
					        </div>
				        </td>
				        <td height="15">
					        <div align="left" style="padding-top:10px;">
                                <%= Html.DropDownList("NhaDat_IDLoaiGia", new SelectList(Model.LoaiGiaModel.GetModel.LstObjModel, "ID", "TenLoaiGia", Model.NhaDatModel.GetModel.LstObjModel[0].IDLoaiGia))%>
					        </div>
				        </td>
					</tr>
                    <tr>
						<td>
							<div align="left" style="padding-top:15px; color: Red;">
								<font class="normal8">TieuBieu: </font>
							</div>
						</td>
						<td height="15">
							<div align="left" style="padding-top:15px; width: 170px;">
                                <%= Html.CheckBox("NhaDat_TieuBieu", bool.Parse(Model.NhaDatModel.GetModel.LstObjModel[0].TieuBieu.ToString()), new { onclick = "CheckOnTieuBieu();" })%>
							</div>
						</td>
					</tr>
                    <tr>
						<td>
							<div align="left" style="padding-top:15px; color: Red;">
								<font class="normal8">TinVip: </font>
							</div>
						</td>
						<td height="15">
							<div align="left" style="padding-top:15px; width: 170px;">
                                <%= Html.CheckBox("NhaDat_TinVip", bool.Parse(Model.NhaDatModel.GetModel.LstObjModel[0].TinVip.ToString()), new { onclick = "CheckOnTinVip();" })%>
							</div>
						</td>
					</tr>
                    <!-- THONG TIN NHA DAT -->
                    <tr>
                        <td colspan="2" style="padding-top: 15px; border-bottom:thin solid #ff0000;">
                            <span style="font-size:14px; font-weight:bold;">Thông tin mô tả</span>
                        </td>
                    </tr>
					<tr>
						<td>
							<div align="left" style="padding-top:15px">
								<font class="normal8">TieuDe: </font>
							</div>
						</td>
						<td height="15">
							<div align="left" style="padding-top:10px">
								<input name="NhaDat_TieuDe" style="width: 450px;" value="<%= Model.NhaDatModel.GetModel.LstObjModel[0].TieuDe %>" />
							</div>
						</td>
					</tr>
                    <tr>
						<td>
							<div align="left" style="padding-top:15px">
								<font class="normal8">NoiDung: </font>
							</div>
						</td>
						<td height="15">
							<div align="left" style="padding-top:10px; width: 140px;">
								<%= Html.TextArea("NhaDat_NoiDung", Model.NhaDatModel.GetModel.LstObjModel[0].NoiDung)%>
							</div>
						</td>
					</tr>
                    <tr>
						<td>
							<div align="left" style="padding-top:15px">
								<font class="normal8">Nội dung rút gọn hiển thị trên trang chủ: </font>
							</div>
						</td>
						<td height="20">
							<div align="left" style="padding-top:15px">
                                <textarea name="NhaDat_NoiDungRutGon" style="width: 590px; height: 80px;"><%= Model.NhaDatModel.GetModel.LstObjModel[0].NoiDungRutGon %></textarea>
							</div>
						</td>
					</tr>
                    <tr>
						<td>
							<div align="left" style="padding-top:15px">
								<font class="normal8">HinhMinhHoa: </font>
							</div>
						</td>
						<td height="15">
							<div align="left" style="padding-top:10px">
								<input type="file" name="NhaDat_HinhMinhHoa" />
                                <br />
								<br />
								<img src="../../Content/Images/Items/<%= Model.NhaDatModel.GetModel.LstObjModel[0].HinhMinhHoa %>" width="120px" height="120px" />
							</div>
						</td>
					</tr>
					<tr>
                        <td height="15" style="width: 100px">
						</td>
						<td height="15">
							<div align="left">
								<br/>
								<p>
									<input type="submit" value="Update" />
								</p>
							</div>
						</td>
                    </tr>
				</tbody>
			</table>
		</div>
	<% } %>
</asp:Content>
